/*
Adept MobileRobots Robotics Interface for Applications (ARIA)
Copyright (C) 2004-2005 ActivMedia Robotics LLC
Copyright (C) 2006-2010 MobileRobots Inc.
Copyright (C) 2011-2015 Adept Technology, Inc.
Copyright (C) 2016-2018 Omron Adept Technologies, Inc.

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

If you wish to redistribute ARIA under different terms, contact 
Adept MobileRobots for information about a commercial version of ARIA at 
robots@mobilerobots.com or 
Adept MobileRobots, 10 Columbia Drive, Amherst, NH 03031; +1-603-881-7960
*/
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.8
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.mobilerobots.Aria;

public class ArGripper {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  public ArGripper(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(ArGripper obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        AriaJavaJNI.delete_ArGripper(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public ArGripper(ArRobot robot, int gripperType) {
    this(AriaJavaJNI.new_ArGripper__SWIG_0(ArRobot.getCPtr(robot), robot, gripperType), true);
  }

  public ArGripper(ArRobot robot) {
    this(AriaJavaJNI.new_ArGripper__SWIG_1(ArRobot.getCPtr(robot), robot), true);
  }

  public boolean gripOpen() {
    return AriaJavaJNI.ArGripper_gripOpen(swigCPtr, this);
  }

  public boolean gripClose() {
    return AriaJavaJNI.ArGripper_gripClose(swigCPtr, this);
  }

  public boolean gripStop() {
    return AriaJavaJNI.ArGripper_gripStop(swigCPtr, this);
  }

  public boolean liftUp() {
    return AriaJavaJNI.ArGripper_liftUp(swigCPtr, this);
  }

  public boolean liftDown() {
    return AriaJavaJNI.ArGripper_liftDown(swigCPtr, this);
  }

  public boolean liftStop() {
    return AriaJavaJNI.ArGripper_liftStop(swigCPtr, this);
  }

  public boolean gripperStore() {
    return AriaJavaJNI.ArGripper_gripperStore(swigCPtr, this);
  }

  public boolean gripperDeploy() {
    return AriaJavaJNI.ArGripper_gripperDeploy(swigCPtr, this);
  }

  public boolean gripperHalt() {
    return AriaJavaJNI.ArGripper_gripperHalt(swigCPtr, this);
  }

  public boolean gripPressure(int mSecIntervals) {
    return AriaJavaJNI.ArGripper_gripPressure(swigCPtr, this, mSecIntervals);
  }

  public boolean liftCarry(int mSecIntervals) {
    return AriaJavaJNI.ArGripper_liftCarry(swigCPtr, this, mSecIntervals);
  }

  public boolean isGripMoving() {
    return AriaJavaJNI.ArGripper_isGripMoving(swigCPtr, this);
  }

  public boolean isLiftMoving() {
    return AriaJavaJNI.ArGripper_isLiftMoving(swigCPtr, this);
  }

  public int getGripState() {
    return AriaJavaJNI.ArGripper_getGripState(swigCPtr, this);
  }

  public int getPaddleState() {
    return AriaJavaJNI.ArGripper_getPaddleState(swigCPtr, this);
  }

  public int getBreakBeamState() {
    return AriaJavaJNI.ArGripper_getBreakBeamState(swigCPtr, this);
  }

  public boolean isLiftMaxed() {
    return AriaJavaJNI.ArGripper_isLiftMaxed(swigCPtr, this);
  }

  public int getType() {
    return AriaJavaJNI.ArGripper_getType(swigCPtr, this);
  }

  public void setType(int type) {
    AriaJavaJNI.ArGripper_setType(swigCPtr, this, type);
  }

  public int getMSecSinceLastPacket() {
    return AriaJavaJNI.ArGripper_getMSecSinceLastPacket(swigCPtr, this);
  }

  public int getGraspTime() {
    return AriaJavaJNI.ArGripper_getGraspTime(swigCPtr, this);
  }

  public void logState() {
    AriaJavaJNI.ArGripper_logState(swigCPtr, this);
  }

  public boolean packetHandler(ArRobotPacket packet) {
    return AriaJavaJNI.ArGripper_packetHandler(swigCPtr, this, ArRobotPacket.getCPtr(packet), packet);
  }

  public void connectHandler() {
    AriaJavaJNI.ArGripper_connectHandler(swigCPtr, this);
  }

  public final static class Type {
    public final static ArGripper.Type QUERYTYPE = new ArGripper.Type("QUERYTYPE");
    public final static ArGripper.Type GENIO = new ArGripper.Type("GENIO");
    public final static ArGripper.Type USERIO = new ArGripper.Type("USERIO");
    public final static ArGripper.Type GRIPPAC = new ArGripper.Type("GRIPPAC");
    public final static ArGripper.Type NOGRIPPER = new ArGripper.Type("NOGRIPPER");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static Type swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + Type.class + " with value " + swigValue);
    }

    private Type(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private Type(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private Type(String swigName, Type swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static Type[] swigValues = { QUERYTYPE, GENIO, USERIO, GRIPPAC, NOGRIPPER };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
